package com.hyacinth.web.ui.easyui;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;

public class DateGrid {

	public static String getData(List<?> list, Class<?> c, String[] fields) {
		SimplePropertyPreFilter spp = new SimplePropertyPreFilter(c, fields);
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("total", list.size());
		map.put("rows", list);
		String str = JSON.toJSONString(map,spp,SerializerFeature.DisableCircularReferenceDetect);
		return str;
	}
}
